#pragma once
#include <iostream>

namespace MyPolymorphism
{
	class O
	{
	public:
		virtual void print() = 0;
	};
	class A
	{
	public:
		virtual void print()//final
		{
			std::cout << _str << std::endl;
		}
	protected:
		std::string _str = "A";
	};

	class B :public A
	{
	public:
		virtual void print()override
		{
			std::cout << _str << std::endl;
		}
	protected:
		std::string _str = "B";
	};

	class C :public B
	{
	public:
		virtual void print()override
		{
			std::cout << _str << std::endl;
		}
	protected:
		std::string _str = "C";
	};
}